using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.SmartClinic
{
    /// <summary>
    /// 当前病人消费明细实体类
    /// </summary>
    [Table("Consumption_details")]
    public class Consumption_details
    {
        /// <summary>
        /// 消费明细ID - 主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Consumption_detailsId { get; set; }

        /// <summary>
        /// 病人挂号ID - 外键，关联Patient_registration表
        /// </summary>
        [Required]
        public int Patient_registrationId { get; set; }

        /// <summary>
        /// 药品名称 - 最大长度100位
        /// </summary>
        [Required]
        [StringLength(100)]
        public string DrugName { get; set; } = string.Empty;

        /// <summary>
        /// 药品单价 - 精确到小数点后2位
        /// </summary>
        [Required]
        [Column(TypeName = "decimal(10,2)")]
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 药品数量
        /// </summary>
        [Required]
        public int Quantity { get; set; }

        /// <summary>
        /// 逻辑删除标志 - 默认false未删除，true已删除
        /// </summary>
        public bool IsDelete { get; set; } = false;

        /// <summary>
        /// 导航属性 - 关联病人挂号表
        /// </summary>
        [ForeignKey("Patient_registrationId")]
        public virtual Patient_registration? PatientRegistration { get; set; }
    }
} 